package STRING;

public class CharAtDemo {
    public static void main(String[] args) {
        String str="thinking in java";
        char c=str.charAt((int) (Math.random()*str.length()));
        System.out.println(c);

        int index=str.indexOf("in");
        System.out.println(index);
        index=str.indexOf("in",3);
        System.out.println(index);
        index=str.indexOf("abc" );
        System.out.println(index);

        index =str.lastIndexOf("in");
        System.out.println(index);
    }
}
